package com.kzw.oa.system.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "fun_url")
public class FunUrl implements Serializable {
	private static final long serialVersionUID = 7766401679722898829L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long urlId;

	@Column
	private String urlPath;

	@ManyToOne
	@JoinColumn(name = "function_id")
	private AppFunction appFunction;

	public FunUrl() {
	}

	public FunUrl(String urlPath) {
		this.urlPath = urlPath;
	}

	public FunUrl(Long in_urlId) {
		this.setUrlId(in_urlId);
	}

	public AppFunction getAppFunction() {
		return appFunction;
	}

	public void setAppFunction(AppFunction in_appFunction) {
		this.appFunction = in_appFunction;
	}

	public Long getUrlId() {
		return this.urlId;
	}

	public void setUrlId(Long aValue) {
		this.urlId = aValue;
	}

	public Long getFunctionId() {
		return appFunction == null ? null : appFunction.getFunctionId();
	}

	public void setFunctionId(Long aValue) {
		if (aValue == null) {
			appFunction = null;
		} else if (appFunction == null) {
			appFunction = new AppFunction(aValue);
		} else {
			appFunction.setFunctionId(aValue);
		}
	}

	public String getUrlPath() {
		return this.urlPath;
	}

	public void setUrlPath(String aValue) {
		this.urlPath = aValue;
	}

}
